package com.itheima.utils;

import com.itheima.pojo.Log;
import com.sun.media.sound.FFT;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Program: health_parent
 * @Description:
 * @Author: choulan
 * @Date:2020-11-29 15:38
 **/
public class LogUtils {
    public static Log createLog(String username, Date date, String operation) throws Exception {
        String formatDate = DateUtils.parseDate2String(date, "yyyy-MM-dd HH:mm:ss");
        Date time = DateUtils.parseString2Date(formatDate,"yyyy-MM-dd HH:mm:ss");
        Log log=new Log();
        log.setTime(time);
        log.setUsername(username);
        log.setOperation(operation);
        return log;
    }
}
